//
import { http } from "@/utils/http";
import { baseUrlApi } from "@/api/utils";
// use 账户管理列表
export function merchantsAccountList(params: any) {
  return http.request(
    "get",
    baseUrlApi("business/merchants_account/listTax"),
    { params }
  );
}

// use 账户管理 筛选  通道
export function listBank() {
  return http.request("get", baseUrlApi("business/bank_account/listBank"));
}
// 账户充值 详情
export function addRechargeBefore(params: any) {
  return http.request(
    "get",
    baseUrlApi("business/merchants_account/addRechargeBefore"),
    { params }
  );
}
// 账户充值
export function addRecharge(params: any) {
  return http.request("post", baseUrlApi("business/recharge_order/add"), {
    data: params
  });
}
// 开户银行列表
export function listCardCodeByName(params: any) {
  return http.request(
    "get",
    baseUrlApi("business/refund_order/listCardCodeByName"),
    { params }
  );
}
// 账户退款
export function addBackstage(params: any) {
  return http.request(
    "post",
    baseUrlApi("business/refund_order/addBackstage"),
    {
      data: params
    }
  );
}
//  账户扣除
export function addDeduction(params: any) {
  return http.request("post", baseUrlApi("business/deduction_order/add"), {
    data: params
  });
}
// 内部转账
export function addaAdjust(params: any) {
  return http.request("post", baseUrlApi("business/adjust_account_order/add"), {
    data: params
  });
}
// 账户类型
export function merchantsAccountType() {
  return http.request("get", baseUrlApi("constantList/merchantsAccountType"));
}
// 流水明细列表
export function detailList(params: any) {
  return http.request(
    "get",
    baseUrlApi("business/finance_flow_merchants/listBackstage"),
    { params }
  );
}
// 充值单列表
export function rechargeList(params: any) {
  return http.request(
    "get",
    baseUrlApi("business/recharge_order/listBackStage"),
    { params }
  );
}
// 交易类型
export function flowMerchantsFlowType() {
  return http.request("get", baseUrlApi("constantList/flowMerchantsFlowType"));
}
// 充值单审核
export function addArecharge(params: any) {
  return http.request("post", baseUrlApi("business/recharge_order/audit"), {
    data: params
  });
}
// 充值单详情
export const getInfo = (id: number | string) => {
  return http.request(
    "get",
    baseUrlApi(`business/recharge_order/getInfo/${id}`)
  );
};

// 退款单详情
export const refundGetInfo = (id: number | string) => {
  return http.request("get", baseUrlApi(`business/refund_order/getInfo/${id}`));
};
// 退款单审核
export function refundAudit(params: any) {
  return http.request("post", baseUrlApi("business/refund_order/audit"), {
    data: params
  });
}
// 退款状态
export function refundOrderState() {
  return http.request("get", baseUrlApi("constantList/refundOrderState"));
}
// 提现单列表
export function withdrawalList(params: any) {
  return http.request("get", baseUrlApi("business/withdrawal_order/list"), {
    params
  });
}
// 提现单详情
export const withdrawalGetInfo = (id: number | string) => {
  return http.request(
    "get",
    baseUrlApi(`business/withdrawal_order/getInfo/${id}`)
  );
};
// 调整单列表
export function adjustlList(params: any) {
  return http.request("get", baseUrlApi("business/adjust_account_order/list"), {
    params
  });
}
// use 资金管理 - 发放记录 批次状态
export function salaryScheduleState() {
  return http.request("get", baseUrlApi("constantList/salaryScheduleState"));
}

// use 资金管理 -下发总额 服务总额
export function getInfoTax(params: any) {
  return http.request(
    "get",
    baseUrlApi("business/salary_payment_schedule/getInfoTax"),
    { params }
  );
}
// use 资金管理 -发放记录列表
export function listByTax(params: any) {
  return http.request(
    "get",
    baseUrlApi("business/salary_payment_schedule/listByTax"),
    { params }
  );
}
// use 资金管理 -发放明细 金额信息
export function getInfoTaxDtl(params: any) {
  return http.request(
    "get",
    baseUrlApi("business/salary_payment_dtl/getInfoTax"),
    { params }
  );
}
// use 资金管理 -发放明细列表
export function listByTaxDtl(params: any) {
  return http.request(
    "get",
    baseUrlApi("business/salary_payment_dtl/listTax"),
    { params }
  );
}

// use 资金管理 -充值记录列表
export function listByTaxRecharge(params: any) {
  return http.request(
    "get",
    baseUrlApi("business/recharge_order/listTax"),
    { params }
  );
}
// use 资金管理 -退款单列表
export function refundList(params: any) {
  return http.request(
    "get",
    baseUrlApi("business/refund_order/listBackstage"),
    { params }
  );
}
// use 资金管理 -退款单列表 搜索服务商
export function listMerchantName(params) {
  return http.request("get", baseUrlApi("business/user_data_permissions/listMerchantName"), { params });
}
